# $Id: PKGBUILD 120558 2011-04-25 17:05:18Z remy $
# Maintainer: Ronald van Haren <ronald.archlinux.org>
# Contributor: Jochem Kossen <j.kossen@home.nl>
# Contributor: Jason Chu <jason.archlinux.org>

pkgname=latex2html
pkgver=2008
pkgrel=2
pkgdesc="a convertor written in Perl that converts LaTeX documents to HTML."
arch=('any')
url="http://www.ctan.org/pkg/latex2html/"
depends=('perl' 'ghostscript' 'texlive-core' 'libpng' 'giflib' 'netpbm')
install=$pkgname.install
license=('GPL2')
source=(http://mirrors.ctan.org/support/${pkgname}/$pkgname-$pkgver.tar.gz
 install-destdir.patch)
md5sums=('275ab6cfa8ca9328446b7f40d8dc302e'
         '5b77601b36abca4fff3e2f75ccf15499')

build() {
	cd $srcdir/$pkgname-$pkgver
	patch -Np0 -i ${srcdir}/install-destdir.patch
	./configure --prefix=/usr \
	    --shlibdir=/usr/lib/$pkgname \
	    --with-texpath=/usr/share/texmf/tex/latex/html \
	    --enable-wrapper \
	    --enable-gif \
	    --enable-png

	make
}

package() {
	cd $srcdir/$pkgname-$pkgver
	make DESTDIR=${pkgdir} install
	
	# set correct permission on executables
	chmod 755 $pkgdir/usr/bin/{pstoimg,texexpand,latex2html}

	# avoid conflict with TeXLive
	rm -f ${pkgdir}/usr/share/texmf/tex/latex/html/url.sty
}
